﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CMTVision.WidgetWeb.Services;

namespace CMTVision.WidgetWeb
{
    public partial class Tester : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindData();        
            }
            TestService();
        }

        protected void BindData()
        {
            List<Model.TemplateType> allTemplateTypes = new List<Model.TemplateType>();
            using(Model.CMTWidgetsEntities entities = CMTVision.Common.EntitiesManager.LoadWidgetEntity())
            {
                allTemplateTypes = (from tt in entities.TemplateTypes select tt).ToList();
            }
            GridView1.DataSource = allTemplateTypes;
            GridView1.DataBind();
        }

        void TestService()
        {
            WidgetsService service = new WidgetsService();
            bool result = service.MoveWidget(2, "Column2", 0, "Column3", 1);
        }

    }
}